<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
// 删除数组里面值跟n相等的
let arr = [1,3,2,5,4,5,4,2,3,1]
let n = 3
let list=[]
for(let i=0; i<arr.length; i++){
    if(arr[i]!=n){
        list[list.length]=arr[i]
    }
}
console.log(list)

    </script>
</body>
</html>